[HVM][SVM] Triple faulkts (shutdown state) causes domain reset.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 3 Jan 2007 10:53:45 +0000 (10:53 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 3 Jan 2007 10:53:45 +0000 (10:53 +0000)
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/svm/svm.c

index 119b3bd625a83a9d4a99021632b148d8cfc77394..8d8de4c513745a95f5771723b620f82967e7a3b9 100644 (file)
@@ -271,8 +271,10 @@ void hvm_hlt(unsigned long rflags)
 
 void hvm_triple_fault(void)
 {
-    gdprintk(XENLOG_INFO, "Triple fault - reset.\n");
-    domain_shutdown(current->domain, SHUTDOWN_reboot);
+    struct vcpu *v = current;
+    gdprintk(XENLOG_INFO, "Triple fault on VCPU%d - "
+             "invoking HVM system reset.\n", v->vcpu_id);
+    domain_shutdown(v->domain, SHUTDOWN_reboot);
 }
 
 /*
index a5ade4c0adb84f3db05a5dca7d734fbad5a733f3..16c03273d62ed05fb47cdfd12f05cc619bf01cf3 100644 (file)
@@ -2701,23 +2701,14 @@ asmlinkage void svm_vmexit_handler(struct cpu_user_regs *regs)
     }
     break;
 
+    case VMEXIT_INTR:
     case VMEXIT_NMI:
-        break;
-
     case VMEXIT_SMI:
-        /*
-         * For asynchronous SMI's, we just need to allow global interrupts 
-         * so that the SMI is taken properly in the context of the host.  The
-         * standard code does a STGI after the VMEXIT which should accomplish 
-         * this task.  Continue as normal and restart the guest.
-         */
+        /* Asynchronous events, handled when we STGI'd after the VMEXIT. */
         break;
 
     case VMEXIT_INIT:
-        /*
-         * Nothing to do, in fact we should never get to this point. 
-         */
-        break;
+        BUG(); /* unreachable */
 
     case VMEXIT_EXCEPTION_BP:
 #ifdef XEN_DEBUGGER
@@ -2779,9 +2770,6 @@ asmlinkage void svm_vmexit_handler(struct cpu_user_regs *regs)
        vmcb->general1_intercepts &= ~GENERAL1_INTERCEPT_VINTR;
        break;
 
-    case VMEXIT_INTR:
-        break;
-
     case VMEXIT_INVD:
         svm_vmexit_do_invd(vmcb);
         break;
@@ -2867,8 +2855,8 @@ asmlinkage void svm_vmexit_handler(struct cpu_user_regs *regs)
         break;
 
     case VMEXIT_SHUTDOWN:
-        gdprintk(XENLOG_ERR, "Guest shutdown exit\n");
-        goto exit_and_crash;
+        hvm_triple_fault();
+        break;
 
     default:
     exit_and_crash: